package com.hitqz.robot.biz.flow.domain.common;

import lombok.Getter;

/**
 * http错误代码枚举
 *
 * @author wengyx
 * @date 2023/08/23
 */
@Getter
public enum FailedCodeEnum {

    SUCCESS(200, "操作成功"),

    FAILED(400, "操作失败"),

    BAD_REQUEST(400, "请求参数错误"),

    UNAUTHORIZED(401, "未认证"),

    FORBIDDEN(403, "禁止访问"),

    NOT_FOUND(404, "资源不存在"),

    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),

    /**
     * 1000-1999 前端xFlow错误
     */
    INVALID_GRAPH_DATA(1001, "图形数据为空"),

    NODE_NODE_UNIQUE(1002, "图形起始/结束节点不唯一"),

    PARAM_JSON_ERROR(1003, "参数不符合json规范"),

    INVALID_EL_DATA(1004, "请先解析规则"),

    INVALID_PROJECT_NAME(1005, "项目名称为空"),
    /**
     * 2000-2999 后台liteFlow错误
     */
    INVALID_EL_RULE(2001, "el解析不符合规范"),

    CHAIN_NO_DEPLOY(2002, "流程未部署"),

    ;

    private final int code;
    private final String msg;

    FailedCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
